package org.lcx.pipeline.example;

import java.util.Random;

import org.lcx.pipeline.Processor;
import org.lcx.pipeline.bean.PipelineExeption;
import org.lcx.pipeline.bean.PipelineResult;

/**
 * 公交车
 */
public class BusProcessor implements Processor {

	@Override
	public int runProcess(Object params, PipelineResult result) throws PipelineExeption {
		int resultint = 0;
		StringBuffer msgFormat = new StringBuffer("坐公交");
		Random random = new Random();
		int randomNum = random.nextInt(10);
		if (randomNum >= 5) {
			msgFormat.append(",公交好慢，我要赶时间.");
			resultint = 1;
		} else {
			msgFormat.append("回家啦");
		}

		System.out.println(msgFormat.toString());
		return resultint;
	}

}
